function changeHeight(obj,target,attribute){
    var speed = 0
    clearInterval(obj.timer)
    obj.timer = setInterval(function(){
        //1.设置缓动动画的步长，逐渐递减
        speed = (target - parseInt(obj.style[attribute])) / 10
        //2.根据动画执行的方向，确定尾数的处理方式
        speed = speed > 0 ? Math.ceil(speed) : Math.floor(speed)
        if(target == parseInt(obj.style[attribute])){
            clearInterval(obj.timer)
        }else{
            obj.style[attribute] = (parseInt(obj.style[attribute]) + speed) + 'px'
        }
    },10)
}

//淡入淡出
function fadeIn_Out(obj,target){
    var speed
    clearInterval(timer)
    timer = setInterval(function(){
        var opacity = parseFloat(window.getComputedStyle(obj,null).opacity)
        speed = (opacity - target) < 0 ? 0.1 : -0.1
        if(opacity - target == 0){
            clearInterval(timer)
        }else{
            obj.style.opacity = opacity + speed
        }
    },100)
}